
// let num = 234
// let s = "str"
// let b = true
// let u = undefined
// // let n = null
// let o = {a: 1}
// let a = [1, 2]
// let f = ()=>{}
// let symbol = Symbol("sss")

// let all = {
//   num,
//   s,
//   b,
//   // u,
//   // n,
//   o, 
//   a,
//   f,
//   symbol
// };

// typeof 判断7种类型

// num typeof ==>  number
// s typeof ==>  string
// b typeof ==>  boolean
// u typeof ==>  undefined
// n typeof ==>  object
// o typeof ==>  object
// a typeof ==>  object
// f typeof ==>  function
// symbol typeof ==>  symbol

// Object.prototype.toString 精确判断 判断9种类型

// num type ==>  [object Number]
// s type ==>  [object String]
// b type ==>  [object Boolean]
// u type ==>  [object Undefined]
// n type ==>  [object Null]
// o type ==>  [object Object]
// a type ==>  [object Array]
// f type ==>  [object Function]
// symbol type ==>  [object Symbol]


// Array.prototype.toString

// TypeError: Cannot convert undefined or null to object

// num type ==>  [object Number]
// s type ==>  [object String]
// b type ==>  [object Boolean]
// o type ==>  [object Object]
// u type ==>  异常
// n type ==>  异常
// a type ==>  1,2
// f type ==>  [object Function]
// symbol type ==>  [object Symbol]

let num = 0
let s = "   "
let b = true
// let u = undefined
// let n = null
let o = {a: 1}
let a = [1, 2]
let f = ()=>{}
let symbol = Symbol("sss")

let all = {
  num,
  s,
  b,
  // u,
  // n,
  o, 
  a,
  f,
  symbol
};

// Object.keys
// TypeError: Cannot convert undefined or null to object
// num  ==>  []
// s  ==>  [ '0', '1', '2' ]
// b  ==>  []
// o  ==>  [ 'a' ]
// a  ==>  [ '0', '1' ]
// f  ==>  []
// symbol  ==>  []

for (const key in all) {
  // console.log( key, "typeof ==> ", typeof all[key])
  // console.log( key, "type ==> ", Object.prototype.toString.call(all[key]))
  // console.log( key, "type ==> ", Object.prototype.toString.call(all[key]).slice(8, -1).toLowerCase())
  // console.log( key, "type ==> ", Array.prototype.toString.call(all[key]))
  // console.log(key, " ==> ", Object.keys(all[key]))
  console.log(key, " ==> ", Object.keys(all[key]) == null)
}


